package com.biz.ssm.security;

import com.alibaba.fastjson.JSONObject;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.io.Serializable;
import java.util.Collection;
import java.util.Set;

public class MyUserDetails extends User implements Serializable {

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	public MyUserDetails(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, true, true, true, true, authorities);
    }
    /**主键ID**/
    private Long id;
    private String token;
    private JSONObject extraParam;
    /**权限**/
    private Set<String> roles;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public JSONObject getExtraParam() {
        return extraParam;
    }

    public void setExtraParam(JSONObject extraParam) {
        this.extraParam = extraParam;
    }

    public Set<String> getRoles() {
        return roles;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }
}

